package com.huibo.algorithm;


import java.util.ArrayList;
import java.util.Random;

/**
 * 单独的染色体类
 */

public class Chromo {
    public ArrayList<Integer> chromo= new ArrayList<>();//需要set染色体长度
    public int len=28;

    private long id ;

    public long getId() {
        return id;
    }

    public Chromo() {
        Random r = new Random();
        for (int i = 0; i < len; i++) {
            chromo.add((Integer) (0));//全都没有，靠突变
        }
        this.id = 0;
    }

    public Chromo(long id) {
        Random r = new Random();
        for (int i = 0; i < len; i++) {
            chromo.add((Integer) (0));//全都没有，靠突变
        }
        this.id = id;
    }

    public int getLen() {
        return len;
    }

    public void setLen(int len) {
        this.len = len;
    }


}
